const onSetColor = (data) => {
  let color = ''
  if (Number(data) < 0) color = 'red'
  return { style: { color: color } }
}
const data = {
  pageData: {
    current: 1,
    size: 20,
    data: [],
    loading: false,
    total: '',
    status: 'pass',
    branch: [],
    distributor: [],
    columns: [{
      title: '经销商名称',
      key: 'distributorContractName',
      align: 'left',
      minWidth: 200,
      tooltip: true
    }, {
      title: '月份',
      key: 'yearAndMonth',
      align: 'left',
      minWidth: 150
    }, {
      title: '返利类型',
      key: 'rebateTypeName',
      align: 'left',
      minWidth: 150
    }, {
      title: '金额（元）',
      key: 'amount',
      align: 'right',
      minWidth: 150,
      render: (h, p) => {
        let text = p.row.amount
        return h('div', onSetColor(p.row.amount), text)
      }
    }, {
      title: '上传人',
      key: 'creator',
      align: 'left',
      minWidth: 150
    }, {
      title: '上传时间',
      key: 'createDate',
      align: 'left',
      minWidth: 200
    }, {
      title: '冲账编号',
      key: 'rushAccountNumber',
      align: 'left',
      minWidth: 150
    }, {
      title: '备注',
      key: 'remark',
      align: 'left',
      minWidth: 200
    }],
    form: {
      distributorId: '',
      officeId: '',
      departmentId: '',
      rebateTypeNos: '',
      yearMonth: '',
      creatorId: '',
      rushAccountNumber: ''
    }
  },
  pageData1: {
    current: 1,
    size: 20,
    total: '',
    data: [],
    branch: [],
    distributor: [],
    status: 'pass',
    loading: false,
    columns: [{
      title: '经销商名称',
      key: 'distributorContractName',
      align: 'left',
      minWidth: 200,
    }, {
      title: '返利类型',
      key: 'rebateTypeName',
      align: 'left',
      minWidth: 150,
    }, {
      title: '1月份',
      key: 'rebateJanuary',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateJanuary
        return h('div', onSetColor(p.row.rebateJanuary), text)
      }
    }, {
      title: '2月份',
      key: 'rebateFebruary',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateFebruary
        return h('div', onSetColor(p.row.rebateFebruary), text)
      }
    }, {
      title: '3月份',
      key: 'rebateMarcy',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateMarcy
        return h('div', onSetColor(p.row.rebateMarcy), text)
      }
    }, {
      title: '4月份',
      key: 'rebateApril',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateApril
        return h('div', onSetColor(p.row.rebateApril), text)
      }
    }, {
      title: '5月份',
      key: 'rebateMay',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateMay
        return h('div', onSetColor(p.row.rebateMay), text)
      }  
    }, {
      title: '6月份',
      key: 'rebateJune',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateJune
        return h('div', onSetColor(p.row.rebateJune), text)
      }
    }, {
      title: '7月份',
      key: 'rebateJuly',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateJuly
        return h('div', onSetColor(p.row.rebateJuly), text)
      }
    }, {
      title: '8月份',
      key: 'rebateAugust',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateAugust
        return h('div', onSetColor(p.row.rebateAugust), text)
      }
    }, {
      title: '9月份',
      key: 'rebateSeptember',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateSeptember
        return h('div', onSetColor(p.row.rebateSeptember), text)
      }
    }, {
      title: '10月份',
      key: 'rebateOctober',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateOctober
        return h('div', onSetColor(p.row.rebateOctober), text)
      }    }, { 
      title: '11月份',
      key: 'rebateNovember',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateNovember
        return h('div', onSetColor(p.row.rebateNovember), text)
      }    }, { 
      title: '12月份',
      key: 'rebateDecember',
      align: 'right',
      minWidth: 100,
      render: (h, p) => {
        let text = p.row.rebateDecember
        return h('div', onSetColor(p.row.rebateDecember), text)
      }    }, 
    // {
    //   title: '操作',
    //   key: 'name',
    //   fixed: 'right',
    //   align: 'left',
    //   minWidth: 200,
    //   render: (h, p) => {
    //     return h('div', [
    //       h('Button', {
    //         props: {
    //           type: 'primary'
    //         },
    //         on: {
    //           click() {
    //             bus.$emit('onPatrolDetail')
    //           }
    //         }
    //       }, '详情')
    //     ])
    //   }
    // }
  ],
  form: {
    distributorId: '',
    departmentId: '',
    officeId: '',
    rebateTypeNos: '',
    year: new Date()
  }
}
}
export default data
